package xyz.xtt.pay.api.enums;

public enum GoodsTypeEnum {
	NFT_CARD(1, "数字藏品实物卡牌"), ASSET_WITH_PHYSICAL(2, "拥有实物的数字资产");

	private final int code;
	private final String desc;

	GoodsTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public int getCode() {
		return code;
	}

	public GoodsTypeEnum getByCode(int code) {
		for (GoodsTypeEnum goodsTypeEnum : GoodsTypeEnum.values()) {
			if (goodsTypeEnum.getCode() == code) {
				return goodsTypeEnum;
			}
		}
		return null;
	}
}
